<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:h="http://java.sun.com/jsf/html"
	  xmlns:f="http://java.sun.com/jsf/core"
	  xmlns:ui="http://java.sun.com/jsf/facelets"
	  xmlns:rich="http://richfaces.org/rich"
	  xmlns:a4j="http://richfaces.org/a4j"
	  xmlns:c="http://java.sun.com/jstl/core">
	
	<head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
        <a4j:loadStyle src="/css/style.css" />
        <title>#{bundle.titulo_app} - #{bundle.login}</title>
    </head>
	
	<body>
		<div class="login" style="width: 25%; margin-left: 36%; margin-top: 15%;">
	        <rich:panel>
				<f:facet name="header">#{bundle.login}</f:facet>
				
				<div class="login_mensagem" align="center">
					<c:choose>
		                <c:when test="#{not empty param.login_error}" >
		                	<font color="red">
								<h:outputText value="#{bundle.login_mensagem_erro}" /> <br />
								<h:outputText value="#{bundle.login_motivo}: #{SPRING_SECURITY_LAST_EXCEPTION.message}." />
							</font>
						</c:when>
						<c:otherwise>
							<h:outputText value="#{bundle.login_mensagem}" />
						</c:otherwise>
					</c:choose>
					<rich:messages style="color:red;"></rich:messages>
				</div>
				
				<a4j:form>
					<div class="linha" />
					
					<h:panelGrid columns="2" width="100%">
						<h:outputText value="#{bundle.login_usuario}:" />
						<h:inputText value="#{sistemaSession.usuarioLogado.usuario}" id="j_username" style="width: 95%;" />
						
						<h:outputText value="#{bundle.login_senha}:" />
						<h:inputSecret value="#{sistemaSession.usuarioLogado.senha}" id="j_password" style="width: 95%;" />
					</h:panelGrid>
	                
	                <div class="linha" />
	                
	                <center>
	                	<h:commandButton type="submit" value="#{bundle.login_btn_logar}" actionListener="#{sistemaSession.verificarUsuarioLogado}" />
	                	<h:commandButton type="reset" value="#{bundle.login_btn_limpar}" actionListener="#{sistemaSession.limparUsuarioLogado}" />
	                </center>
                </a4j:form>
			</rich:panel>
		</div>
    </body>

</html>